Skip to main content

Main system’s callbacks

Main system callbacks for interacting with the provider are described in this section.

Note: The provider is required to close opened rounds using the endRound parameter (set to true) on the last debit or credit request in the round. The provider must not send additional transactions on a closed round. If round closure is a separate event, sending a credit with amount=0 and endRound=true is an accepted alternative. See the FAQ for details.

Uniqueness requirements

Both roundId and transactionId must be globally unique across the entire system. See the FAQ for workarounds when per-currency uniqueness is needed.


Login

The login callback is used to authenticate users or sessions by validating a provided token. This ensures secure access to the system and enables users to interact with the casino games. The provider must include the token in the request body to successfully log in.

{server-name}/api/web/casino/providers/{provider-name}/login

Request
ParameterMandatoryType
token+string

Example of the request body:

{
"token": "4d51a59042e94c6ef2f6f9ebc3deb800"
}

Note: The token for login request is received by the provider together with the request to open the game.

Response
ParameterDescriptionMandatoryType
tokenSession token that is used in further requests+string
balanceCurrent user’s balance+float
currencySession’s currency+string
nicknameUser’s nickname+string
timestampThe time when request was processed+string
countryIf user’s country is specified, it will be stated in the response as well-string
userIdThe ID of the user in the Evenbet system+integer
currencyPrecisionCurrency precision in the Evenbet system. See FAQ for the conversion formula and examples. This parameter is mandatory for new integrations. For previously completed integrations, it is not mandatory but can be activated upon request.-/+integer

Example of the response body:

{
"token": "46e42cb6773df9e8530e341a4fd0596d",
"balance": 1000,
"currency": "USD",
"nickname": "T61FDsyff",
"timestamp": "1659884338009",
"userId": "67234"
}

Balance

The balance callback is used to retrieve the current balance of a user's account. Upon successful validation, the system responds with the user's balance information.

{server-name}/api/web/casino/providers/{provider-name}/balance

Request
ParameterMandatoryType
token+string

Example of the request body:

{
"token": "46e42cb6773df9e8530e341a4fd0596d"
}

Note: This is the token received at login request.

Response
ParameterDescriptionMandatoryType
balanceCurrent user’s balance+float
timestampThe time when request was processed+string

Example of the response body:

{
"balance": 1000,
"timestamp": "1659924382527"
}

Debit

The debit callback facilitates the deduction of funds from a user's balance within the casino platform.

Note: All rounds must have at least one debit transaction.

{server-name}/api/web/casino/providers/{provider-name}/debit

Important

All debit transactions are processed idempotently. If the same transaction ID is sent again by the provider, the system checks whether it was previously processed. If it was successful, a success response is returned without reprocessing. If the original attempt failed the transaction will be processed again when the provider resends it.

Retries: If a debit transaction returns a standard error (e.g., insufficient funds, limit exceeded), no rollback or retry is required. Retries are only needed for the Internal server error, Transaction is pending, or undefined errors with a non-standard format.

Request
ParameterDescriptionMandatoryType
token+string
gameIdGame ID+string
endRoundShows if the round is completed+bool
roundIdGame round ID+string
transactionIdExternal transaction ID+string
amountBet amount+float
freeSpinPackageIdEvenbet used FreeSpins' package ID-integer
usedFreeSpinsQuantityThe number of used FreeSpins-integer

Example of the request body:

{
"token": "46e42cb6773df9e8530e341a4fd0596d",
"gameId": "some-game",
"endRound": false,
"roundId": "test-round-1",
"transactionId": "test-transaction-0912",
"amount": 100
}
Response
ParameterDescriptionMandatoryType
balanceCurrent user’s balance+float
transactionIdInternal transaction ID+string
timestampThe time when request was processed+string

Example of the response body:

{
"balance": 9900,
"transactionId": "86",
"timestamp": "1659925530134"
}

For details on Debit callback related to FreeSpins, check this article.


Credit

The credit callback is used to credit winnings to a user's account within the casino platform.

{server-name}/api/web/casino/providers/{provider-name}/credit

Note: Credit transaction can only be created if there is a completed debit transaction in the round or if there is a rolled back debit transaction in the round in case the amount of the current transaction is 0. A credit with amount=0 is the standard way to close a round when the player did not win.

Important

All credit transactions are processed idempotently. If the same transaction ID is sent again by the provider, the system checks whether it was previously processed. If it was successful, a success response is returned without reprocessing. If the original attempt failed the transaction will be processed again when the provider resends it.

Retries: Credit transactions must always be completed. If an error occurs, the provider should continue retrying until the transaction is successfully processed, regardless of the error type. The only exceptions are Error Code 4 and Error Code 9, for which retries are not required.

Request
ParameterDescriptionMandatoryType
token+string
gameIdGame ID+string
endRoundShows if the round is completed+bool
roundIdGame round ID+string
transactionIdExternal transaction ID+string
amountWinnings amount+float
freeSpinPackageIdEvenbet used FreeSpins' package ID-integer
usedFreeSpinsQuantityThe number of used FreeSpins-integer

Example of the request body:

{
"token": "46e42cb6773df9e8530e341a4fd0596d",
"gameId": "some-game",
"endRound": true,
"roundId": "test-round-1",
"transactionId": "test-transaction-0912",
"amount": 200
}
Response
ParameterDescriptionMandatoryType
balanceCurrent user’s balance+float
transactionIdInternal transaction ID+string
timestampThe time when request was processed+string

Example of the response body:

{
"balance": 1100,
"transactionId": "87",
"timestamp": "1659925530134"
}

For details on Credit callback related to FreeSpins, check this article.


Rollback

The rollback callback is used to revert a previous debit transaction. The provider should initiate a rollback when a debit request times out, receives no response, returns a malformed response, or returns error code 900 (GENERAL_ERROR). Keep retrying the rollback until a successful response is received. For edge cases, see the FAQ.

info

To ensure consistent transaction history and avoid errors, it is recommended to perform Credit transaction rollback before Debit transaction rollback.

{server-name}/api/web/casino/providers/{provider-name}/rollback

Important

All rollback transactions are processed idempotently. If the same transaction ID is sent again by the provider, the system checks whether it was previously processed. If it was successful, a success response is returned without reprocessing. If the original attempt failed the transaction will be processed again when the provider resends it.

Retries: Rollback transactions must always be completed. If an error occurs, the provider should continue retrying until the transaction is successfully processed, regardless of the error type. The only exceptions are Error Code 4 and Error Code 9, for which retries are not required.

Request
ParameterDescriptionMandatoryType
token+string
gameIdExternal game ID+string
endRoundShows if the round is completed. By default, if the parameter is not set,
endRound is false in the case of a Credit transaction Rollback and true in the case of a Debit Rollback.
-bool
roundIdGame round ID+string
transactionIdExternal transaction ID+string
refTransactionIdExternal ID of the transaction that must be rolled back+string

Example of the request body:

{
"token": "46e42cb6773df9e8530e341a4fd0596d",
"gameId": "some-game",
"roundId": "test-round-1",
"transactionId": "test-rollback-transaction",
"refTransactionId": "test-transaction-0912",
}
Response
ParameterDescriptionMandatoryType
balanceCurrent user’s balance+float
transactionIdInternal transaction ID+string
timestampThe time when request was processed+string

Example of the response body:

{
"balance": 900,
"transactionId": "88",
"timestamp": "1659925530134"
}

Logout

The logout callback closes the session with the ID sent in the request. This request is not manadatory.

{server-name}/api/web/casino/providers/{provider-name}/logout

Request
ParameterMandatoryType
token+string

Example of the request body:

{
"token": "46e42cb6773df9e8530e341a4fd0596d"
}
Response
ParameterDescriptionMandatoryType
balanceCurrent user’s balance+float
currencySession’s currency+string
nicknamePlayer’s nickname+string
timestampThe time when request was processed+string
userIdThe ID of the user in the Evenbet system+integer

Example of the response body:

{
"balance": 900,
"currency": "USD",
"nickname": "T61FDsyff",
"timestamp": "1659884338009",
"userId": "67234"
}